package cn.ac.iie.main;

import cn.ac.iie.util.RedisUtil;
import cn.ac.iie.util.RedissonUtil;
import org.redisson.RedissonClient;

/**
 *
 * @author zmc
 */
public class Main {

    static String hosts = "192.168.11.94:16379;192.168.11.95:16379;192.168.11.96:16379";
    static String masterName = "mymaster";
    static String masterAddress = "192.168.11.96:56379";
    static int deploymentModel = 3;

    public static void main(String[] args) throws InterruptedException {
        RedisUtil util = new RedisUtil(hosts, masterName);
        RedissonUtil client = new RedissonUtil(hosts, masterName, masterAddress, deploymentModel);
        RedissonClient redisson = client.getClient();
        for (int i = 0; i < 100; i++) {
            TestLockThread testLockThread = new TestLockThread(redisson, util);
            testLockThread.start();
        }
    }
}
